home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / Libraries / SAT 2.3b4 / Misc / SATminimalX ƒ / SATminimalX.p < prev    next >
Text File  |  1994-08-23  |  1KB  |  43 lines

  1. {Minimal demo program, with a few sprites moving back and forth.}
  2.  
  3. {This variation of SATminimal uses three PICTs, one for color, one for b/w and one for the mask, for the}
  4. {sprite faces instead of "cicn" resources. This file is the same as always, but InitMySprite in sMySprite.p}
  5. {has changed.}
  6.  
  7. {Isn't the result perfect? No, it isn't, since I havn't bothered to get that exact pixel alignment needed. That's}
  8. {why "cicn"s are so much nicer!}
  9.  
  10. program SATminimalX;
  11.  
  12.     uses
  13.         SAT, sMySprite;
  14.     var
  15.         ignoreSp: SpritePtr;
  16.         l: longint;
  17. begin
  18. {Standard Inits are done by Think Pascal.}
  19.  
  20. {Initialize, using PICTs 128 or 129 as background, Classic-sized drawing area}
  21.     SATInit(128, 129, 512, 322);
  22.  
  23. {Initialize sprite unit(s), by preloading faces and sounds}
  24.     InitMySprite;
  25.  
  26. {Make some sprites}
  27.     ignoreSp := SATNewSprite(0, 50, 50, @SetupMySprite);
  28.     ignoreSp := SATNewSprite(0, 100, 100, @SetupMySprite);
  29.     ignoreSp := SATNewSprite(0, 125, 120, @SetupMySprite);
  30.     ignoreSp := SATNewSprite(0, 150, 140, @SetupMySprite);
  31.     ignoreSp := SATNewSprite(0, 200, 180, @SetupMySprite);
  32.     ignoreSp := SATNewSprite(0, 250, 200, @SetupMySprite);
  33.     ignoreSp := SATNewSprite(0, 300, 250, @SetupMySprite);
  34.  
  35.     repeat
  36.         l := TickCount;
  37.         SATRun(true); {Run one frame of animation}
  38.         while l > TickCount - 3 do {Maximize speed to 20 fps}
  39.             ;
  40.     until Button;
  41.  
  42.     SATSoundShutUp; {Always de-allocate the sound channel before quitting!}
  43. end.